<template>
	<view>
		<view class="mobile-item-container">
			<view style="font-size: 40rpx; font-weight: bold; padding: 0 0 40rpx 0;">入库</view>
			<view style="padding: 20rpx 0;">
				<u-grid col="3" style="align-items: center;">
					<u-grid-item @click="navigateTo('/pages/work/inBound/inBound')">
						<text class="iconfont">&#xe708;</text>
						<text class="btn-text">入库作业</text>
					</u-grid-item>
					<u-grid-item @click="navigateTo('/pages/work/inBound/returnInbound')">
						<text class="iconfont">&#xe708;</text>
						<text class="btn-text">良退入库</text>
					</u-grid-item>
					<u-grid-item @click="navigateTo('/pages/work/inBound/bindContainer')">
						<text class="iconfont">&#xe70c;</text>
						<text class="btn-text">绑定载具</text>
					</u-grid-item>
				</u-grid>
			</view>
			<view style="padding: 20rpx 0;">
				<u-grid col="3" style="align-items: center;">
					<u-grid-item @click="navigateTo('/pages/work/inBound/qualityMaterial')">
						<text class="iconfont">&#xe70d;</text>
						<text class="btn-text">质检抽料</text>
					</u-grid-item>
					<u-grid-item @click="navigateTo('/pages/work/inBound/callCar')">
						<text class="iconfont">&#xe705;</text>
						<text class="btn-text">绑定叫车</text>
					</u-grid-item>
				</u-grid>
			</view>
		</view>
		<Gap />
		<view class="mobile-item-container">
			<view style="font-size: 40rpx; font-weight: bold; padding: 0 0 40rpx 0;">在库</view>
			<u-grid col="3" style="align-items: center;">
				<u-grid-item @click="navigateTo('/pages/work/storage/check')">
					<text class="iconfont">&#xe701;</text>
					<text class="btn-text">盘点作业</text>
				</u-grid-item>
				<u-grid-item @click="navigateTo('/pages/work/storage/containerMerge')">
					<text class="iconfont">&#xe700;</text>
					<text class="btn-text">移库合箱</text>
				</u-grid-item>
			</u-grid>
		</view>
		<Gap />
		<view class="mobile-item-container">
			<view style="font-size: 40rpx; font-weight: bold; padding: 0 0 40rpx 0;">出库</view>
			<view style="padding: 20rpx 0;">
				<u-grid col="3" style="align-items: center;">
					<u-grid-item @click="navigateTo('/pages/work/outbound/bindOrder')">
						<text class="iconfont">&#xe706;</text>
						<text class="btn-text">绑定订单</text>
					</u-grid-item>
					<u-grid-item @click="navigateTo('/pages/work/outbound/scanOff')">
						<text class="iconfont">&#xe6fe;</text>
						<text class="btn-text">扫码下架</text>
					</u-grid-item>
					<u-grid-item @click="navigateTo('/pages/work/outbound/callCar')">
						<text class="iconfont">&#xe705;</text>
						<text class="btn-text">叫车</text>
					</u-grid-item>
				</u-grid>
			</view>
			<view style="padding: 20rpx 0;">
				<u-grid col="3" style="align-items: start;">
					<u-grid-item @click="navigateTo('/pages/work/outbound/splitMaterialReShelf')">
						<text class="iconfont">&#xe6f9;</text>
						<text class="btn-text" style="text-align: center;">拆分物料重</br>上架</text>
					</u-grid-item>
					<u-grid-item @click="navigateTo('/pages/work/outbound/scanOffUp')">
						<text class="iconfont">&#xe6fa;</text>
						<text class="btn-text">上架出库</text>
					</u-grid-item>
				</u-grid>
			</view>
		</view>
		<Gap />
		<view class="mobile-item-container">
			<view style="font-size: 40rpx; font-weight: bold; padding: 0 0 40rpx 0;">其他</view>
			<u-grid col="3" style="align-items: center;">
				<u-grid-item @click="navigateTo('/pages/work/other/pointToPoint')">
					<text class="iconfont">&#xe705;</text>
					<text class="btn-text">点对点叫车</text>
				</u-grid-item>
				<u-grid-item @click="navigateTo('/pages/work/other/feederDismantle')">
					<text class="iconfont">&#xe6fa;</text>
					<text class="btn-text">feeder区下架</text>
				</u-grid-item>
				<u-grid-item @click="navigateTo('/pages/work/other/manualCall')">
					<text class="iconfont">&#xe6f9;</text>
					<text class="btn-text">手动叫料</text>
				</u-grid-item>
			</u-grid>
		</view>
		<scan-code></scan-code>
	</view>
</template>

<script>
	import Gap from '@/components/gap/Gap'
	import scanCode from "@/components/scanCode/scan-code.vue"

	export default {
		components: {
			Gap,
			scanCode
		},
		data() {
			return {
			}
		},
		mounted() {
			// #ifdef APP-PLUS
			this.getDeviceMac()
			// #endif
		},
		onShow: function() {
			// var _this = this
			// uni.$off('scancodedate') // 每次进来先 移除全局自定义事件监听器  
			// uni.$on('scancodedate', function(data) {
			// 	console.log('你想要的code：', data.code)
			// })
		},
		methods: {
			navigateTo(url) {
				uni.navigateTo({
					url: url
				})
			},
			getDeviceMac() {
				const net = plus.android.importClass("java.net.NetworkInterface")
				const wl0 = net.getByName('wlan0')
				const macByte = wl0.getHardwareAddress()
				const parts = []
				for (let i = 0; i < macByte.length; i++) {
					let num = macByte[i]
					if (num < 0) num = 256 + num      // 负数转正
					let hex = num.toString(16)
					if (hex.length === 1) hex = '0' + hex
					parts.push(hex)
				}
			
				const macWithColon = parts.join(':') // b4:29:3d:7e:49:5b
				console.log(macWithColon)
				this.$store.commit('SET_MAC_ADDRESS', macWithColon)
			}
		}
	}
</script>

<style>
	@import '@/common/icon/iconfont.css'
</style>